{extends file="./main.tpl"}
{block name="head"}
<script>
function party(partyType)
{
  var dataString = "partyType=" + partyType
  $.ajax({
	  type: "GET",
	  url: "getParty.php",
	  data: dataString,
	  success:function(data)
	  {
	    $('.partyNameGet').html(data);
    }
  });
}
</script>
{/block}
{block name=body}
<br />
<form name="partyForm" action="{$smarty.server.PHP_SELF}" method="post">
<table align="center" border="1">
<tr>
  <td align="center" class="table1" colspan="8">Transaction</td>
</tr>
<tr>
  <th class="table2" align="right" >Party Type</th>
  <td class="table2">
    <select name="partyType" id="partyType" onchange="party(this.value);" required autofocus />
      <option value="">All</option>
      {html_options values=$partyTypeComboArray.partyType output=$partyTypeComboArray.partyType}
    </select>	
  </td>
  <th class="table2" align="right">Party Name</th>
  <td class="table2">
    <select name="partyId" class="partyNameGet">
      <option value="">Party Name</option>
      {html_options values=$partyComboArray.partyId output=$partyComboArray.partyName}
	  </select>
  </td>
  <th class="table2" align="right">Date</th>
  <td class="table2" colspan="3">{html_select_date prefix="curDate" start_year ="-0" end_year="+2" field_order="DMY" month_format="%m" day_value_format="%02d"}</td>
</tr>                           
<tr>
  <th class="table2" align="right">Amount</th>
  <td class="table2"><input type="text" name="amount" /></td>
  <th class="table2" align="right">Credit</th>
  <td class="table2" colspan="">
    <select name="credit">
      <option> Select</option>
      <option value="Dr">Dr</option>
      <option value="Cr">Cr</option>
    </select>	
  </td>
  <th class="table2">Transaction In</th>
  <td class="table2" colspan="">
    <select name="transactionIn">
      <option> Select</option>
      {html_options values=$tranctionInArray.transactionId output=$tranctionInArray.transactionName}
    </select>	
  </td>
  <th class="table2" align="right">cash Place</th>
  <td class="table2"><input type="text" name="cashPlace" /></td>
</tr>
<tr>
	<th class="table2" align="left">Contact Person</th>
  <td class="table2" colspan=""><input type="text" name="contactPerson"></td>
  <th class="table2" align="right">Narration</th>
  <td class="table2" colspan="5"><textarea name="narration" rows="3" cols="25"></textarea></td>
</tr>

<!--------------------------------------------------------->
<tr>
  <td class="table2" colspan="8"><hr></td>
</tr>
<tr>
  <th class="table2" align="right">Angadiya Name</th>
  <td class="table2"><input type="text" name="angadiyaName" /></td>
  
  <th class="table2" align="right">Angadiya Charge</th>
  <td class="table2"><input type="text" name="angadiyaCharge" /></td>
  
  <th class="table2" align="right">Pay</th>
  <td class="table2" colspan="3">
    <select name="pay">
      <option> Select</option>
      <option value="Paid">By Us</option>
      <option value="topay">By Party</option>
    </select>	
  </td>
</tr>

<!--------------------------------------------------------->
<tr>
	<th class="table2" align="right">Receipt No :</th>
  <td class="table2"><input type="text" name="receiptNo"></td>
  <th class="table2" align="left">Angadiya Date</th>
  <td class="table2"  colspan="5">{html_select_date prefix="angadiya" start_year ="-0" end_year="+2" field_order="DMY" month_format="%m" day_value_format="%02d"}</td>
<tr>
  <td colspan="8" align="center" class="table1"><input type="submit" name="submitBtn" value="Submit" class="button" /></td>
</tr>
</table>
</form>
<br /><br /><br />
<table align="center" border=2>
<tr>
  <th class="table1" NOWRAP>Action</th>
  <th class="table1" NOWRAP>Party Type</th>
  <th class="table1" NOWRAP>Party Name</th>
  <th class="table1" NOWRAP>Date</th>
  <th class="table1" NOWRAP>Amount</th>
  <th class="table1" NOWRAP>Credit</th>
  <th class="table1" NOWRAP>TransactionName</th>
  <th class="table1" NOWRAP>Cash Place</th>
  <th class="table1" NOWRAP>Angadiya Name</th>
  <th class="table1" NOWRAP>Angadiya Charge</th>
  <th class="table1" NOWRAP>Pay</th>
  <th class="table1" NOWRAP>Contact Person</th>
  <th class="table1" NOWRAP>Angadiya</th>
  <th class="table1" NOWRAP>Angadiya Date</th>
  <th class="table1" NOWRAP>receiptNo</th>
  <th class="table1" NOWRAP>type</th>
  <th class="table1" NOWRAP>Narration</th>
</tr>
{section name="sec" loop=$partyArray}
<tr>
	<td class="table2"><a href="partyTypeDelete.php?partyDetailId={$partyArray[sec].partyDetailId}" onclick="return confirm('Sure to Delete?');"class="link"><img src="./images/deleteIco.png"></a></td>
  <td class="table2">{$partyArray[sec].partyType}</td>
  <td class="table2">{$partyArray[sec].partyDetailName}</td>
  <td class="table2" NOWRAP>{$partyArray[sec].partyDate}</td>
  <td class="table2">{$partyArray[sec].amount}</td>
  <td class="table2">{$partyArray[sec].credit}</td>
  <td class="table2">{$partyArray[sec].transactionIn}</td>
  <td class="table2">{$partyArray[sec].cashPlace}</td>
  <td class="table2">{$partyArray[sec].angadiyaName}</td>
  <td class="table2">{$partyArray[sec].angadiyaCharge}</td>
  <td class="table2">{$partyArray[sec].pay}</td>
  <td class="table2">{$partyArray[sec].contactPerson}</td>
  <td class="table2">{$partyArray[sec].angadiya}</td>
  <td class="table2">{$partyArray[sec].angadiyaDate}</td>
  <td class="table2">{$partyArray[sec].receiptNo}</td>
  <td class="table2">{$partyArray[sec].type}</td>
  <td class="table2">{$partyArray[sec].narration}</td>
</tr>
{/section}
</table>
{/block}